import { IFeidaoAiBrowserComponent } from '@dfeidao/atom-web/interfaces';
import set from '@dfeidao/atom-web/local/set';
import storage_get from '@dfeidao/atom-web/storage/get';

import nodejs from '@dfeidao/atom-web/msg/nodejs';
import render from '@dfeidao/atom-web/render/render';
import P01 from './P01';

export default async function a001(fd: IFeidaoAiBrowserComponent) {
	// 初始化
	const node = fd.data.node.querySelector<HTMLDivElement>('[data-feidao-name="zj2"]');
	node.classList.remove('display-n');


	const productid = storage_get('productid');
	set(fd, 'productid', productid);
	const res1 = await nodejs<{ dataArray: Array<{}>, page_no: number, page_size: number }>('tenant-inf/zj-000002/s001', { filter: { productid } });

	render(fd, res1.dataArray, P01, 'P01', 'inner');
}
